# 保存淘宝登录信息,cookies: 一串字符串
# 以便于selenium淘宝搜索内容的直接模拟登录，不弹出登录接界面
import time
import json
from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://login.taobao.com/')

time.sleep(10)
dictCookies = driver.get_cookies()
print(dictCookies)

jsonCookies = json.dumps(dictCookies)

with open('cookie_tao.json', 'w') as f:
    f.write(jsonCookies)
